package net.lab1024.sa.admin.module.business.sp.domain.form;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.lab1024.sa.base.common.json.deserializer.FileKeyVoDeserializer;
import net.lab1024.sa.base.common.json.serializer.FileKeyVoSerializer;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
@Data
public class SpAddForm {

        @Schema(description = "商品名称")
        @NotBlank(message = "商品名称不能为空")
        private String spName;
        @Schema(description = "所属商店编号")
        @NotNull(message = "商店编号不能为空")
        private Long shopId;
        @Schema(description = "商品类型")
        @NotBlank(message = "商品类型不能为空")
        private String spType;

        @Schema(description = "商品图片")
        @JsonSerialize(using = FileKeyVoSerializer.class)
        @JsonDeserialize(using = FileKeyVoDeserializer.class)
        private String spPic;

        @Schema(description = "商品价格")
        @NotNull(message = "商品价格不能为空")
        @DecimalMin(value = "0", message = "商品价格最低0")
        private BigDecimal spPrice;

        @Schema(description = "备注|可选")
        private String reMark;

}
